<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\AddressService;

class Address extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    /**
     * 列表
     *
     */
    public function lists()
    {
        $res = AddressService::getList();
        return json($res);
    }

    /**
     * 添加
     *
     */
    public function add()
    {
        $data = $this->request->post();
        $res = AddressService::add($data);
        return json($res);
    }

    /**
     * 加减数量
     *
     */
    public function edit()
    {
        $data = $this->request->post();
        $res = AddressService::edit($data);
        return json($res);
    }

    /**
     * 删除商品
     *
     */
    public function del()
    {
        $data = $this->request->post();
        $res = AddressService::delete($data);
        return json($res);
    }


}